package org.jeecg.modules.innerApi.leqiApi.requestVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

/**
* @Create: 2023/11/13
* @Description：乐企发票票开具发票明细
*/
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "乐企发票票开具发票明细")
public class LQInvoiceMxParam implements Serializable {

    /**
    * 明细序号
    */
    @ApiModelProperty(value = "明细序号")
    private Integer mxxh;

    /**
     * 对应蓝字发票明细序号（红票必传）
     */
    @ApiModelProperty(value = "对应蓝字发票明细序号")
    private String dylzfpmxxh;
    /**
     * 项目名称
     */
    @ApiModelProperty(value = "项目名称")
    private String xmmc;

    /**
     * 货物或应税劳务、服务名称 拼装规则：“*商品服务简称（spfwjc）*”+“项目名称（xmmc）”
     */
    @ApiModelProperty(value = "货物或应税劳务、服务名称")
    private String hwhyslwfwmc;

    @ApiModelProperty(value = "商品服务简称")
    private String spfwjc;

    /**
     * 规格型号
     */
    @ApiModelProperty(value = "规格型号")
    private String ggxh;
    /**
     * 单位
     */
    @ApiModelProperty(value = "单位")
    private String dw;
    /**
     * 数量
     */
    @ApiModelProperty(value = "数量")
    private String sl;

    /**
     * 单价
     */
    @ApiModelProperty(value = "单价")
    private BigDecimal dj;
    /**
     * 金额
     */
    @ApiModelProperty(value = "金额")
    private BigDecimal je;

    /**
     * 增值税税率/征收率
     */
    @ApiModelProperty(value = "增值税税率/征收率")
    private BigDecimal slv;

    /**
     * 税额
     */
    @ApiModelProperty(value = "税额")
    private BigDecimal se;
    /**
     * 含税金额
     */
    @ApiModelProperty(value = "含税金额")
    private BigDecimal hsje;
    /**
     * 扣除额
     */
    @ApiModelProperty(value = "扣除额")
    private BigDecimal kce;

    /**
     * 商品和服务税收分类合并编码
     */
    @ApiModelProperty(value = "商品和服务税收分类合并编码")
    private String sphfwssflhbbm;

    /**
     * 发票行性质
     */
    @ApiModelProperty(value = "发票行性质")
    private String fphxz;

    /**
     * 发票行性质枚举
     */
    public static enum fphxzEnum {
        zch ("正常行","00"),
        zkh ("折扣行","01"),
        bzkh ("被折扣行","02");
        private final String desc;//描述
        private final String value;//值
        fphxzEnum (String desc, String value) {
            this.desc = desc;
            this.value = value;
        }
    }

    /**
     * 优惠政策标识
     */
    @ApiModelProperty(value = "优惠政策标识")
    private String yhzcbs;
    /**
     * 优惠政策标识枚举
     */
    public static enum yhzcbsEnum {
        jyzs ("简易征收","01"),
        xtcp ("稀土产品","02"),
        ms ("免税","03"),
        bzs ("不征税","04"),
        xzht ("先征后退","05"),
        xzht_100 ("100%先征后退","06"),
        xzht_50 ("50%先征后退","07"),
        jyzs_3 ("按3%简易征收","08"),
        jyzs_5 ("按5%简易征收","09"),
        jyzs_5_ja15jz ("按5%简易征收减按1.5%计征","10"),
        jzjt_30 ("即征即退30%","11"),
        jzjt_50 ("即征即退50%","12"),
        jzjt_70 ("即征即退70%","13"),
        jzjt_100 ("即征即退100%","14"),
        csf_3_jzjt ("超税负3%即征即退","15"),
        csf_8_jzjt ("超税负8%即征即退","16"),
        csf_12_jzjt ("超税负12%即征即退","17"),
        csf_6_jzjt ("超税负6%即征即退","18"),
        ;
        private final String desc;//描述
        private final String value;//值
        yhzcbsEnum (String desc, String value) {
            this.desc = desc;
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public String getValue() {
            return value;
        }

        public static String getDescByValue(String value) {
            for(yhzcbsEnum yhzcbs : yhzcbsEnum.values()){
                if(yhzcbs.getValue().equalsIgnoreCase(value)){
                    return yhzcbs.getDesc();
                }
            }
            return null;
        }
    }
}
